<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.css">
    <script src="https://unpkg.com/swiper/js/swiper.js"> </script>
    <title>Document</title>
    <style>
        .swiper-container {
            width: 600px;
            height: 300px;
        }

    </style>
</head>

<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide" id="slider1">slider1</div>
            <div class="swiper-slide" id="slider2">slider2</div>
            <div class="swiper-slide" id="slider3">slider3</div>
        </div>
        
        <!-- 如果需要导航按钮 -->
        <!-- <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div> -->
        
        <!-- 如果需要滚动条 -->
        <div class="swiper-scrollbar"></div>
    </div>
    <script>
        var mySwiper = new Swiper('.swiper-container', {
            loop: true,
            autoplay: true,//可选选项，自动滑动

            // 如果需要前进后退按钮
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },

            // 如果需要滚动条
            scrollbar: {
                el: '.swiper-scrollbar',
            },
        })
    </script>
</body>

</html>